﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace UI.Desktop
{
    public partial class frmPrincipal : Form
    {
        public frmPrincipal()
        {
            InitializeComponent();
        }
        private Business.Entities.Personal Personal;

        public frmPrincipal(DataSet dsper)
        {
            InitializeComponent();
            Personal = new Business.Entities.Personal();
            string dni = dsper.Tables["Personal"].Rows[0][0].ToString();
            Personal.ObtenerDatosPersonal(dni);
            toolStripStatusLabel1.Text = "  Nombre: " + dsper.Tables["Personal"].Rows[0][2].ToString() + " " + dsper.Tables["Personal"].Rows[0][3].ToString();
            toolStripStatusLabel2.Text = "  ID: " + dsper.Tables["Personal"].Rows[0][1].ToString();
            toolStripStatusLabel3.Text = "  Status: " + dsper.Tables["Personal"].Rows[0][9].ToString();
            toolStripStatusLabel4.Text = "Fecha: " + DateTime.Now.ToShortDateString() + "  Hora: " + DateTime.Now.ToShortTimeString();
            //toolStripStatusLabel5.Text = "  Hora: " + DateTime.Now.ToShortTimeString();
            
        }

        private void frmPrincipal_Load(object sender, EventArgs e)
        {

        }

        private void acercaDeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            {
                if (Application.OpenForms["frmAcercaDe"] != null)
                {
                    Application.OpenForms["frmAcercaDe"].Activate();
                }
                else
                {
                    frmAcercaDe acerca = new frmAcercaDe();
                    acerca.frmPrincipal = this;
                    acerca.Show();
                }
            }
        }

        private void btnAltaPaciente_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["GestionPacientes"] != null)
            {

                Application.OpenForms["GestionPacientes"].Activate();
            }
            else
            {
                frmAltaPaciente clientes = new frmAltaPaciente();
                clientes.frmPrincipal = this;
                clientes.Show();
            }
        }

        private void darDeAltaPacienteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            btnAltaPaciente_Click(sender, e);
        }

        private void altaProfesionalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            btnAltaProf_Click(sender, e);
        }

        private void btnAltaProf_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["GestionProfesional"] != null)
            {

                Application.OpenForms["GestionProfesional"].Activate();
            }
            else
            {
                frmAltaProfesional profesional = new frmAltaProfesional();
                profesional.frmPrincipal = this;
                profesional.Show();
            }
        }

        private void salirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void darDeAltaToolStripMenuItem1_Click(object sender, EventArgs e)
        {

            frmAltaEspecialidad especialidad = new frmAltaEspecialidad();

            especialidad.Show();


        }

        private void btnAltaUusario_Click(object sender, EventArgs e)
        {
            frmAltaPersonal personal = new frmAltaPersonal();
            personal.Show();
        }

        private void cerrarSesionToolStripMenuItem_Click(object sender, EventArgs e)
        {


        }

        private void btnTurno_Click(object sender, EventArgs e)
        {
            frmAltaTurno T = new frmAltaTurno();
            T.Show();


        }

        private void btnEditarPersonal_Click(object sender, EventArgs e)
        {
            frmEditarUsuario Ep = new frmEditarUsuario();
            Ep.Show();
        }

        private void buscarModificarOEliminarToolStripMenuItem1_Click(object sender, EventArgs e)
        {

        }

        private void nuevoTurnoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            btnTurno_Click(sender, e);
        }

        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem4_Click(object sender, EventArgs e)
        {
            frmReporteTurnos rp = new frmReporteTurnos();
            rp.Show();
            rp.WindowState = FormWindowState.Maximized;



        }

        private void buscarModificarOEliminarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmEditarPaciente EP = new frmEditarPaciente();
            EP.Show();
        }


        private void ModificarVisibilidad()
        {
            tabControl1.Visible=false;
        }

        private void toolStripMenuItem2_Click_1(object sender, EventArgs e)
        {
            frmReportePaciente rp = new frmReportePaciente();
            rp.Show();
            rp.WindowState = FormWindowState.Maximized;
        }

        private void buscarTurnoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmGestionTurnos Gt = new frmGestionTurnos();
            Gt.Show();
        }

        private void buscarEliminarOModificarToolStripMenuItem_Click(object sender, EventArgs e)
        {
           frmGestionProfesional eP = new frmGestionProfesional();
            eP.Show();
        }

        private void buscarModificarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmEditarProfesional EP = new frmEditarProfesional();
            EP.Show();
        }



    }
}